#!/bin/sh
########################################################################
# Begin dbus
#
# Description : Start dbus daemon
#
# Author      : Bruce Dubbs - bdubbs@linuxfromscratch.org
#
# Version     : LFS 7.0
#
########################################################################

### BEGIN INIT INFO
# Provides:            dbus
# Required-Start:      cleanfs
# Should-Start:        $remote_fs
# Required-Stop:       sendsignals
# Should-Stop:
# Default-Start:       2 3 4 5
# Default-Stop:        0 1 6
# Short-Description:   Starts message bus.
# Description:         Starts message bus.
# X-LFS-Provided-By:   LFS
### END INIT INFO

. /etc/rc.d/functions

#$LastChangedBy: bdubbs $
#$Date: 2012-05-02 15:39:55 -0500 (Wed, 02 May 2012) $

pidfile=/run/dbus/pid
socket=/run/dbus/system_bus_socket

case "$1" in
   start)
      log_info_msg "D-Bus Messagebus Daemon başlatılıyor..."
      mkdir -p /run/dbus
      /usr/bin/dbus-uuidgen --ensure
      start_daemon /usr/bin/dbus-daemon --system
      evaluate_retval
      ;;

   baslat)
      log_info_msg "D-Bus Messagebus Daemon başlatılıyor..."
      mkdir -p /run/dbus
      /usr/bin/dbus-uuidgen --ensure
      start_daemon /usr/bin/dbus-daemon --system
      evaluate_retval
      ;;

   stop)
      log_info_msg "D-Bus Messagebus Daemon durduruluyor..."
      killproc /usr/bin/dbus-daemon
      evaluate_retval
      rm -f $socket $pidfile
      ;;

   durdur)
      log_info_msg "D-Bus Messagebus Daemon durduruluyor..."
      killproc /usr/bin/dbus-daemon
      evaluate_retval
      rm -f $socket $pidfile
      ;;

   restart)
      $0 stop
      sleep 1
      $0 start
      ;;

   ybaslat)
      $0 stop
      sleep 1
      $0 start
      ;;

   status)
      statusproc /usr/bin/dbus-daemon
      ;;

   durum)
      statusproc /usr/bin/dbus-daemon
      ;;

   *)
      echo "Kullanımı: $0 {baslat|durdur|ybaslat|durum}"
      echo "Usage: $0 {start|stop|restart|status}"
      exit 1
      ;;
esac

# End /etc/init.d/dbus
